package de.karlNet.gifSocket;

import java.awt.Rectangle;
import java.util.HashMap;

import org.springframework.stereotype.Component;

import de.karlNet.gifSocket.controllers.interfaces.ISession;

@Component
public class SessionStorage {
	private HashMap<Integer, Session> sessionMapping = new HashMap<Integer, Session>();

	public ISession getSession(Integer sessionNumber) {
		return this.sessionMapping.get(sessionNumber);
	}

	public ISession createNewSession(Rectangle screenSize) {
		Session newSession = new Session(screenSize);
		this.sessionMapping.put(newSession.getSessionNumber(), newSession);
		return newSession;
	}
}
